package com.bookstore.controller;

import com.bookstore.entity.po.BookClassOP;
import com.bookstore.entity.pojo.R;
import com.bookstore.service.BookClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("bookClass")
public class BookClassController {
    @Autowired
    BookClassService bookClassService;
    @GetMapping()
    public R getAllClassNames() {
        List<BookClassOP> list = bookClassService.list();
        return R.success(list);
    }
}
